package com.sq.partner.manager.dao.impl.credit;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.credit.CreditRiskDao;
import com.sq.partner.manager.dao.impl.BaseDaoImpl;
import com.sq.partner.manager.mybatis.model.CreditRisk;
import com.sq.partner.manager.util.LogUtil;
@Repository
public class CreditRiskDaoImpl extends BaseDaoImpl implements CreditRiskDao {

	private static Logger logger = LogUtil.getLog(CreditRiskDaoImpl.class); 
	@Override
	public List<CreditRisk> selectCreditRisk(String prodCode) throws SQLException {
		return this.queryList("queryCreditRiskById", prodCode);
	}

	@Override
	public boolean updateCreditRisk(CreditRisk creditRisk) throws Exception {
		return this.update("updateCreditRiskNotNull", creditRisk);
	}

	@Override
	public boolean addCreditRisk(CreditRisk creditRisk) throws Exception {
		return this.add("insertCreditRisk", creditRisk);
	}

	@Override
	public boolean delCreditRiskByProdId(String prodCode) throws Exception {
		return this.delete("delCreditRiskByProdId", prodCode);
	}

	@Override
	public List<CreditRisk> impCreditRisk(Map<String, Object> map)
			throws Exception {
		return this.queryList("impCreditRiskByMap", map);
	}

	@Override
	public boolean delCreditRiskByRisk(CreditRisk creditRisk) throws Exception {
		return this.delete("delCreditRiskByRisk", creditRisk);
	}

}
